﻿@{
    ViewBag.Title = "CounterFunc";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Counter - Return Function</h2>

<script type="text/javascript">
    var counter = function () {
        var count = 0;
        return function () {
            return (count += 1);
        };
    };

    var next = counter();

    window.onload = function () {
        ZEUS.DEBUG.log("First Time Call: " + next());
        ZEUS.DEBUG.log("Second Time Call: " + next());
    };
</script>